<extend name="Base/common"/>

<block name="side">

</block>
<block name="body">
    <php>
        query_user(array('avatar128','username','uid'));
    </php>
    <div class="col-md-12">
        <div class="row">
            <div class="col-md-9 weibo_main" style="margin-top: 10px">
                <div class="row">
                    <if condition="is_login()">
                        <div class="hot_post" style="margin-top: 0;padding-bottom: 10px">
                            <div class="row">
                                <div class="col-md-2">
                                    <script>
                                        var names = {$atwhousers};

                                        var names = $.map(names, function (value, i) {
                                            return {'id': i, 'name': value.username, 'pinyin': value.pinyin};
                                        });
                                        var at_config = {
                                            at: "@",
                                            data: names,
                                            tpl: "<li data-value='@${name}'>${name}</li>",
                                            show_the_at: true,
                                            search_key: 'pinyin',
                                            start_with_space:false
                                        };
                                        $(function () {
                                            $inputor = $('#weibo_content').atwho(at_config);
                                        })

                                    </script>
                                    <a href="{:U('UserCenter/Index/changeavatar')}"><img src="{$self.avatar128}"
                                                                                         class="avatar-img"/></a>
                                </div>

                                <div class="col-md-6">
                                    <a style="font-size: 1.2em;width: 100%" title="{$self.username}" class="text-more"
                                       href="{$self.space_url}">{$self.username}</a>&nbsp;{$self.icons_html}
                                    <br/>积分：{$self.score}
                                    <br/>头衔：{$self.title}
                                </div>


                                <div class="col-md-4 row">
                                    <div style="margin: 10px;text-align: center">
                                        <div class="col-md-4">
                                            微博<br/>{$self.weibocount}
                                        </div>
                                        <div class="col-md-4">
                                            粉丝<br/>{$self.fans}
                                        </div>
                                        <div class="col-md-4">
                                            关注<br/>{$self.following}
                                        </div>
                                    </div>
                                </div>
                            </div>

                        </div>
                    </if>
                </div>

                <div class="row">
                    <div class="col-md-12" style="padding-top: 10px">
                        <p>
                            <img src="__IMG__/ad.png" style="width: 100%;"/>
                        </p>
                    </div>
                </div>
                <hr>
                <div id="weibo_list">
                    <div class="row" id="weibo_{$weibo.id}">
                        <div class="col-md-12">
                            <div style="padding-left: 16px; overflow: hidden;">
                                <p>{$weibo.content}</p>

                                <div>

                                    <span class="text-primary">{$weibo.create_time|friendlyDate}</span>

                                    <div class="pull-right operation" style="margin-bottom: .5em">
                                        <php>
                                            $weiboCommentTotalCount = $weibo['comment_count'];
                                        </php>
                                        <include file="_operation"/>
                                    </div>
                                </div>

                                <div class="row weibo-comment-list" style="display: none;"
                                     data-weibo-id="{$weibo.id}">
                                    <div class="col-md-12">
                                        <div class="light-jumbotron" style="padding: 1em 2em;">
                                            <div class="weibo-comment-container">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="col-md-3">

                <div>
                    {:hook('Rank')}

                    {:W('UserList/lists',array('forum_id'=>$forum_id))}
                </div>
            </div>

        </div>
    </div>
</block>

<block name="script">
    <script type="text/javascript" src="__STATIC__/oneplus/js/ext/atwho/atwho.js"></script>
    <link type="text/css" rel="stylesheet" href="__STATIC__/oneplus/js/ext/atwho//atwho.css"/>
    <script src="__JS__/weibo.js"></script>
    <script>
        var auto_open_detail = 1;
        $(function () {
            var noMoreNextPage = false;
            var isLoadingWeibo = false;
            var currentPage = 1;
        })
    </script>
</block>
